package com.machuxin.course.patterns.proxy.simple;

import com.machuxin.course.patterns.proxy.jdklib.BuyHouse;

public class Proxy implements BuyHouse {

    private BuyHouse subject;

    public Proxy(BuyHouse subject) {
        this.subject = subject;
    }


    private void after() {
        System.out.println("调用之前");
    }

    private void before() {
        System.out.println("调用之后");
    }

    @Override
    public void buyHouse() {
        before();
        subject.buyHouse();
        after();
    }
}
